#include "String.h"
#include "../smartPtr/smartPtr.h"

String getObj()
{
    return String();
}

int main()
{
    // String s("hello");
    // cout << s << endl;
    // smartPtr<String> obj(new String(s));
    // cout << *obj << endl;

    // {
    //     // vector<smartPtr<String>> table(5, new String("jason")); 
    //     String *p = new String[5];
    //     delete [] p;               
    // }
    // string s2("132");
    // String s1 = s+s2;
    // cout << s1 << endl;
    // 定义时候初始化那么就是拷贝构造函数
    String s ("hello");
    {
        cout << "-----------test 1 ---------" << endl;
        String s1 = s;
    }
    // 先声明再赋值就是重载=运算符
    {
        cout << "-----------test 2 ---------" << endl;
        String s2;
        s2 = s;
    }

    {
        cout << "-----------test 3 ---------" << endl;
        String s3 = move(String("hello"));
    }

    {
        cout << "-----------test 4 ---------" << endl;
        String s3;
    }
    {
        cout << "-----------test 5 ---------" << endl;
        String s1 = move(getObj());
        String s;
        s = move(s1);
    }
    {
        cout << "-----------test 6 ---------" << endl;
        vector<String> table(1);
        String t("waht");
        cout << t[1] << endl;
        table.push_back(move(t));\  
    }
}